<?php
    $cs = Yii::app()->clientScript;
    $cs->registerScriptFile(Html::jsUrl("tweet.js"));
?>
<!-- DEFINE URL -->
<script>
    GET_TWEET_URL = '<?php echo $this->createUrl('/api/tweet/user_timeline/',array('user_id'=>$user->id))?>';
</script>

<!-- DEFINE TEMPLATE-->
<script id="tweetTemplate" type="text/template">
    <?php 
        $this->renderPartial('/tweet/_tweetTemplate')        
    ?>
</script>
<script id="tweetTemplateExpanded" type="text/template">
    <?php 
        $this->renderPartial('/tweet/_tweetTemplateExpanded')        
    ?>
</script>

<!-- Prepare list tweet-->
<script>
    var tweetList = <? echo CJSON::encode(TweetCore::user_timeline($user->id))?>;
</script>

<div id="timeline" class="content-main js-timeline-from-cache">
    <div class="content-header">
        <div class="header-inner">
            <h2 class="js-timeline-title">Tweets
            </h2>
        </div>
    </div>
    <div data-since-id="242943728682143745" data-max-id="221896852373635071" class="stream-container">
        <div class="stream profile-stream">
            <div id="stream-items-id" class="stream-items">  

            </div>
            <div class="stream-footer"><div class="timeline-end has-items has-more-items">
                    <div class="stream-end">
                        <div class="stream-end-inner">
                            <i class="bird-etched"></i>
                            <p class="empty-text">@books4experts hasn't tweeted yet.</p>
                            <p><button class="btn-link back-to-top hidden" type="button" style="display: inline-block;">Back to top ↑</button></p>  </div>
                    </div>
                    <div class="stream-loading">
                        <div class="stream-end-inner">
                            <span title="Loading..." class="spinner"></span>
                        </div>
                    </div>
                </div></div>
            <div class="stream-fail-container">
                <div class="js-stream-whale-end stream-whale-end stream-placeholder centered-placeholder">
                    <div class="stream-end-inner">
                        <h2 class="title">Loading seems to be taking a while.</h2>
                        <p>
                            Twitter may be over capacity or experiencing a momentary hiccup. <a class="try-again-after-whale" href="#">Try again</a> or visit <a href="http://status.twitter.com" target="_blank">Twitter Status</a> for more information.
                        </p>
                    </div>
                </div>      </div>
            <div class="stream-autoplay-marker">
                <i class="arrow"></i>
                <span class="text"></span>
            </div>
        </div>
    </div>

</div>
